package leetcode.code055;

public class Solution extends Solution055 {

	@Override
	public boolean canJump(int[] nums) {
		int max = 0;
		for (int i = 0; i < nums.length && i <= max; i++) {
			max = Math.max(max, i + nums[i]);
			if (max >= nums.length - 1)
				return true;
		}
		return false;
	}

	public static void main(String[] args) {
		Solution so = new Solution();
		so.debug1();
		so.debug2();
	}

}
